package common.utils.msg;


import org.springframework.http.HttpStatus;

/**
 * <p>异常返回报错信息</p>
 *@author zwy
 *@date 2025/3/14 11:44
*/

public enum RespFailMsg implements IRespFailMsg {
    FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value()),
    UNAUTHORIZED(HttpStatus.UNAUTHORIZED.value(), "无权限"),
    NOT_ACCEPTABLE(HttpStatus.NOT_ACCEPTABLE.value()),
    ACCOUNT_NOT_FOUND(HttpStatus.NOT_ACCEPTABLE.value(), "账号不能为空"),
    CONFLICT(HttpStatus.CONFLICT.value(), "已存在相同数据"),
    NOT_FOUND(HttpStatus.NOT_FOUND.value()),
    OPT_TIMEOUT(HttpStatus.NOT_ACCEPTABLE.value(), "操作超时，请重试"),
    TWO_PASSWORD_ERROR(HttpStatus.NOT_ACCEPTABLE.value(), "二次密码不一致"),
    USER_OR_PASSWORD_ERROR(HttpStatus.NOT_FOUND.value(), "用户名或密码错误");

    private final Integer code;
    private String message;

    @Override
    public Integer getCode() {
        return code;
    }
    RespFailMsg(Integer code) {
        this.code = code;
    }

    RespFailMsg(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    @Override
    public String getMessage() {
        return message;
    }
}
